
class Person{
    public String name;
    public int age;

    static {
        System.out.println("Person::static{}");
    }
    {
        System.out.println("Person::{}");
    }
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Person(String,int)");
    }
}
class Student extends Person{
    public Student(String name, int age) {
        super(name, age);
        System.out.println("Student(String,int)");
    }
    static {
        System.out.println("Student::static{}");
    }
    {
        System.out.println("Student::{}");
    }
}
public class TestDemo3 {
    public static void main(String[] args) {
        Person person=new Person("小花",12);
        System.out.println("==================");
        Person person2=new Student("小明",18);//1 和2的执行顺序相同
        System.out.println("==================");
        Student student=new Student("小贝",13);//2
    }
}
